package com.sky.constant;

public enum SourceTypeEnum {

    SYSTEM(0, "系统"),
    WECHAT(1, "微信"),
    GITHUB(2, "GitHub"),
    GITEE(3, "码云");

    private Integer sourceType;

    private String sourceTypeName;

    SourceTypeEnum(Integer sourceType, String sourceTypeName) {
        this.sourceType = sourceType;
        this.sourceTypeName = sourceTypeName;
    }

    public Integer getSourceType() {
        return sourceType;
    }

    public String getSourceTypeName() {
        return sourceTypeName;
    }

    public static String getSourceTypeName(Integer sourceType) {
        for (SourceTypeEnum sourceTypeEnum : SourceTypeEnum.values()) {
            if (sourceTypeEnum.getSourceType().equals(sourceType)) {
                return sourceTypeEnum.getSourceTypeName();
            }
        }
        return null;
    }
}
